# -*- coding:utf-8 -*-
"""Created By Corvo"""

from const import *
from ...module.system.base import *


class MusicModuleClient(ModuleClientBase):
    """音乐模块客户端"""
    __mVersion__ = 3
    __identifier__ = ModuleEnum.identifier

    def ConfigEvent(self):
        super(MusicModuleClient, self).ConfigEvent()
        self.serverEvent.update({
            ServerEvent.RequestPlayMusicEvent: self.RequestPlayMusicEvent
        })

    def RequestPlayMusicEvent(self, args):
        entityId = args.get("entityId")
        name = args["name"]
        stop = args.get("stop", 0)
        self.PlayMusic(entityId, name, stop=stop)
